package com.company;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

public class syssys {
    private JTextField textField1;
    private JTextField textField2;
    private JTextField textField3;
    private JTextField textField4;
    private JTextField textField5;
    private JButton 报表导出Button;
    private JButton 设置Button;
    private JPanel panel1;

    public syssys() {
        JFrame syss=new JFrame("系统管理");
        syss.setSize(400,400);
        syss.add(panel1);
        syss.setLocation(400,250);
        syss.setVisible(true);
        报表导出Button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Export ex=new Export();
                ex.exportToCsv();
            }
        });
        设置Button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String[] qinshi=new String[5];
                qinshi[0]=textField1.getText();
                qinshi[1]=textField2.getText();
                qinshi[2]=textField3.getText();
                qinshi[3]=textField4.getText();
                qinshi[4]=textField5.getText();
                ZSGC zs=new ZSGC();
                try {
                    zs.zengjia1(qinshi);
                    JOptionPane.showConfirmDialog(null, "设置成功");
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }

            }
        });
    }

    public static void main(String[] args) {
        syssys sy=new syssys();
    }
    private void createUIComponents() {
        // TODO: place custom component creation code here
    }
}
